//
//  CarNumQueryController.m
//  PropertyMananger
//
//  Created by bh on 17/4/5.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "CarNumQueryController.h"
#import "PayQueryCell.h"
#import "PayParkingDetController.h"
#import "QueryResultModel.h"

@interface CarNumQueryController ()

@end

@implementation CarNumQueryController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initTitleViewName:@"停车缴费查询"];
    
    [self initTableViewWithView:self.view frame:CGRectMake(0, 0, BHscreenW, BHscreenH - 64) isGroup:NO];
    
    self.tableView.separatorStyle = NO;
    self.tableView.backgroundColor = BHGrayColor;

    
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return self.propertyArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 1;
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    PayQueryCell * cell = [PayQueryCell cellWithTableView:tableView indexPath:indexPath];
    
    QueryResultModel * model = self.propertyArray[indexPath.section];
    cell.selectedType = self.selectedType;
    cell.model = model;
    
    
    return cell;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 150;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    if (section == 0) {
        
        return 0.001f;
    }else{
        return 15;
    }
    
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    PayParkingDetController * queryDetVC = [[PayParkingDetController alloc]init];
    QueryResultModel * model = self.propertyArray[indexPath.section];
    queryDetVC.model = model;
    [self.navigationController pushViewController:queryDetVC animated:YES];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
